Optimal. Leaf size=44 \[ a x+b \sqrt {c} \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )+b x \tanh ^{-1}\left (\frac {c}{x^2}\right )-b \sqrt {c} \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {6021, 269, 304,
209, 212} \begin {gather*} a x+b \sqrt {c} \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )+b x \tanh ^{-1}\left (\frac {c}{x^2}\right )-b \sqrt {c} \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 212
Rule 269
Rule 304
Rule 6021
Rubi steps
\begin {align*} \int \left (a+b \tanh ^{-1}\left (\frac {c}{x^2}\right )\right ) \, dx &=a x+b \int \tanh ^{-1}\left (\frac {c}{x^2}\right ) \, dx\\ &=a x+b x \tanh ^{-1}\left (\frac {c}{x^2}\right )+(2 b c) \int \frac {1}{\left (1-\frac {c^2}{x^4}\right ) x^2} \, dx\\ &=a x+b x \tanh ^{-1}\left (\frac {c}{x^2}\right )+(2 b c) \int \frac {x^2}{-c^2+x^4} \, dx\\ &=a x+b x \tanh ^{-1}\left (\frac {c}{x^2}\right )-(b c) \int \frac {1}{c-x^2} \, dx+(b c) \int \frac {1}{c+x^2} \, dx\\ &=a x+b \sqrt {c} \tan ^{-1}\left (\frac {x}{\sqrt {c}}\right )+b x \tanh ^{-1}\left (\frac {c}{x^2}\right )-b \sqrt {c} \tanh ^{-1}\left (\frac {x}{\sqrt {c}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.01, size = 54, normalized size = 1.23 \begin {gather*} a x+b x \tanh ^{-1}\left (\frac {c}{x^2}\right )+\frac {1}{2} b \sqrt {c} \left (2 \text {ArcTan}\left (\frac {x}{\sqrt {c}}\right )+\log \left (\sqrt {c}-x\right )-\log \left (\sqrt {c}+x\right )\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 39, normalized size = 0.89
method | result | size |
default | \(a x +b x \arctanh \left (\frac {c}{x^{2}}\right )+b \arctan \left (\frac {x}{\sqrt {c}}\right ) \sqrt {c}-b \sqrt {c}\, \arctanh \left (\frac {\sqrt {c}}{x}\right )\) | \(39\) |
derivativedivides | \(a x +b x \arctanh \left (\frac {c}{x^{2}}\right )-b \sqrt {c}\, \arctan \left (\frac {\sqrt {c}}{x}\right )-b \sqrt {c}\, \arctanh \left (\frac {\sqrt {c}}{x}\right )\) | \(42\) |
risch | \(a x +\frac {b x \ln \left (x^{2}+c \right )}{2}-\frac {b x \ln \left (-x^{2}+c \right )}{2}+\frac {i b \pi x \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{2}}{4}-\frac {i b \pi x \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{3}}{4}+\frac {i b \pi x \,\mathrm {csgn}\left (i \left (x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{2}}{4}+\frac {i b \pi x \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (i \left (-x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )}{4}-\frac {i b \pi x \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )^{3}}{4}+\frac {i b \pi x \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}}{2}-\frac {i b \pi x \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}}{4}-\frac {i b \pi x \,\mathrm {csgn}\left (i \left (-x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (-x^{2}+c \right )}{x^{2}}\right )^{2}}{4}-\frac {i b \pi x}{2}-\frac {i b \pi x \,\mathrm {csgn}\left (\frac {i}{x^{2}}\right ) \mathrm {csgn}\left (i \left (x^{2}+c \right )\right ) \mathrm {csgn}\left (\frac {i \left (x^{2}+c \right )}{x^{2}}\right )}{4}+\frac {b \sqrt {c}\, \ln \left (-\sqrt {c}+x \right )}{2}-\frac {b \sqrt {c}\, \ln \left (x +\sqrt {c}\right )}{2}+\frac {b \sqrt {-c}\, \ln \left (x +\sqrt {-c}\right )}{2}-\frac {b \sqrt {-c}\, \ln \left (-\sqrt {-c}+x \right )}{2}\) | \(347\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.46, size = 51, normalized size = 1.16 \begin {gather*} \frac {1}{2} \, {\left (c {\left (\frac {2 \, \arctan \left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}} + \frac {\log \left (\frac {x - \sqrt {c}}{x + \sqrt {c}}\right )}{\sqrt {c}}\right )} + 2 \, x \operatorname {artanh}\left (\frac {c}{x^{2}}\right )\right )} b + a x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] Leaf count of result is larger than twice the leaf count of optimal. 74 vs.
\(2 (36) = 72\).
time = 0.49, size = 138, normalized size = 3.14 \begin {gather*} \left [\frac {1}{2} \, b x \log \left (\frac {x^{2} + c}{x^{2} - c}\right ) + b \sqrt {c} \arctan \left (\frac {x}{\sqrt {c}}\right ) + \frac {1}{2} \, b \sqrt {c} \log \left (\frac {x^{2} - 2 \, \sqrt {c} x + c}{x^{2} - c}\right ) + a x, \frac {1}{2} \, b x \log \left (\frac {x^{2} + c}{x^{2} - c}\right ) + b \sqrt {-c} \arctan \left (\frac {\sqrt {-c} x}{c}\right ) + \frac {1}{2} \, b \sqrt {-c} \log \left (\frac {x^{2} + 2 \, \sqrt {-c} x - c}{x^{2} + c}\right ) + a x\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 2.10, size = 632, normalized size = 14.36 \begin {gather*} a x + b \left (\begin {cases} 0 & \text {for}\: c = 0 \\- \infty x & \text {for}\: c = - x^{2} \\\infty x & \text {for}\: c = x^{2} \\- \frac {2 c^{\frac {5}{2}} \sqrt {- c} \log {\left (- \sqrt {c} + x \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} + \frac {c^{\frac {5}{2}} \sqrt {- c} \log {\left (x - \sqrt {- c} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} + \frac {c^{\frac {5}{2}} \sqrt {- c} \log {\left (x + \sqrt {- c} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} - \frac {2 c^{\frac {5}{2}} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} + \frac {2 \sqrt {c} x^{4} \sqrt {- c} \log {\left (- \sqrt {c} + x \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} - \frac {\sqrt {c} x^{4} \sqrt {- c} \log {\left (x - \sqrt {- c} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} - \frac {\sqrt {c} x^{4} \sqrt {- c} \log {\left (x + \sqrt {- c} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} + \frac {2 \sqrt {c} x^{4} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} - \frac {c^{3} \log {\left (x - \sqrt {- c} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} + \frac {c^{3} \log {\left (x + \sqrt {- c} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} - \frac {2 c^{2} x \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} + \frac {c x^{4} \log {\left (x - \sqrt {- c} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} - \frac {c x^{4} \log {\left (x + \sqrt {- c} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} + \frac {2 x^{5} \sqrt {- c} \operatorname {atanh}{\left (\frac {c}{x^{2}} \right )}}{- 2 c^{2} \sqrt {- c} + 2 x^{4} \sqrt {- c}} & \text {otherwise} \end {cases}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 57, normalized size = 1.30 \begin {gather*} \frac {1}{2} \, {\left (2 \, c {\left (\frac {\arctan \left (\frac {x}{\sqrt {-c}}\right )}{\sqrt {-c}} + \frac {\arctan \left (\frac {x}{\sqrt {c}}\right )}{\sqrt {c}}\right )} + x \log \left (-\frac {\frac {c}{x^{2}} + 1}{\frac {c}{x^{2}} - 1}\right )\right )} b + a x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.82, size = 52, normalized size = 1.18 \begin {gather*} a\,x+\frac {b\,x\,\ln \left (x^2+c\right )}{2}+b\,\sqrt {c}\,\mathrm {atan}\left (\frac {x}{\sqrt {c}}\right )-\frac {b\,x\,\ln \left (x^2-c\right )}{2}+b\,\sqrt {c}\,\mathrm {atan}\left (\frac {x\,1{}\mathrm {i}}{\sqrt {c}}\right )\,1{}\mathrm {i} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________